package com.frxuexi.park2212.fragment

import android.os.Bundle
import androidx.fragment.app.Fragment
import android.view.LayoutInflater
import android.view.View
import android.view.ViewGroup
import com.alibaba.android.arouter.launcher.ARouter
import com.blankj.utilcode.util.SPUtils
import com.frxuexi.lib_base.base.BaseViewFragment
import com.frxuexi.lib_base.net.Const
import com.frxuexi.park2212.R
import com.frxuexi.park2212.databinding.FragmentServiceBinding
import dagger.hilt.android.AndroidEntryPoint

@AndroidEntryPoint
class ServiceFragment : BaseViewFragment<FragmentServiceBinding>() {
    override fun initData() {

    }

    override fun initView() {
        binding.servicePark.setOnClickListener {
            start("/app/ParkActivity")
        }

        binding.serviceRepair.setOnClickListener {
            start("/app/RepairActivity")
        }

        binding.serviceVisit.setOnClickListener {
            start("/app/VisitActivity")
        }

        binding.serviceSign.setOnClickListener {
            start("/app/SignListActivity")
        }

        binding.servicePatrol.setOnClickListener {
            start("/app/PointActivity")
        }

        binding.serviceTask.setOnClickListener {
            start("/app/TaskActivity")
        }

        binding.serviceCharge.setOnClickListener {
            if(SPUtils.getInstance().getInt(Const.ROLE,0)==2){
                start("/app/AddPayProjectActivity")
            }
        }

    }

    fun start(url:String){
        ARouter.getInstance().build(url).navigation()
    }


}